package com.zhq.zhq_blog.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zhq.zhq_blog.entity.PraiseTblogTuser;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

/**
 *  Mapper 接口
 */
@Repository
public interface PraiseTblogTuserMapper extends BaseMapper<PraiseTblogTuser> {

    @Select("SELECT count(*) FROM `tb_praise_tblog_tuser` t WHERE t.blog_id = #{blog_id}")
    Integer queryPraiseCount(@Param("blog_id") Integer blog_id);

    @Select("SELECT count(*) FROM `tb_praise_tblog_tuser` t WHERE t.blog_id = #{blog_id} AND t.user_id = #{user_id}")
    Integer myPraisedCount(@Param("blog_id") Integer blog_id, @Param("user_id") Integer user_id);

}
